package com.yunwushanhe.service.impl;

import com.yunwushanhe.util.UserContextUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 抬头看看天
 * @Date 2023-08-23  16:39:45
 */
@Service("aps")
public class AdminPermissionService {

    public boolean hasPermission(String permission){
        if(UserContextUtil.isAdmin()){
            return true;
        }
        List<String> permissionList = UserContextUtil.getLoginUser().getPermissionList();
        return permissionList.contains(permission);
    }

}
